﻿using System.Collections.Generic;

namespace Sautom.CompositionRoot.AutoMapperConfiguration
{
    public static class AutoMapperConfigurator
    {
        private static ICollection<Base> Configurations { get; set; }

        public static void ConfigureMapping()
        {
            if (Configurations == null) return;

            foreach (var configuration in Configurations)
            {
                configuration.ApplyConfiguration();
            }
        }

        public static void AddConfiguration(params Base[] configurations)
        {
            if (Configurations == null) Configurations = new List<Base>(configurations.Length);

            foreach (var configuration in configurations)
            {
                Configurations.Add(configuration);
            }
        }
    }
}
